.homeUserContent
	md-content.md-whiteframe-1dp(aria-label="Licenses", flex)
		md-toolbar
			.md-toolbar-tools
				h2 Licenses

		.userContent
			div(ng-switch="vm.toShow")
				div(ng-switch-when="0")
					.cardInfo
						p You do not currently have any licenses.
						br
						p
							| Please go to the
							=" "
							a(href="", ng-click="vm.goToBillingPage()") Billing Page
							=" "
							| to add licenses.

				div(ng-switch-when="0+")
					#accountLicensesAdd
						div(flex="30", layout="column")
							p Assign a license
							md-input-container
								label Username
								input(
								type="text"
								ng-model="vm.newLicenseAssignee"
								tdr-focus="true"
								ng-disabled="vm.allLicensesAssigned"
								ng-keypress="vm.assignLicense($event)")
						div(layout="row")
							md-button.md-raised.md-accent(ng-click="vm.assignLicense()", ng-disabled="vm.addDisabled") Assign
							p {{vm.addMessage}}

					md-divider

					// Assigned
					md-content#accountLicensesList
						section
							md-subheader
								div Licenses ({{vm.numLicensesAssigned}} assigned, {{vm.numLicenses}} total)
						md-list-item(ng-repeat="license in vm.licenses", layout="row", layout-align="space-between", flex)
							div(layout="row", layout-align="start center", flex)
								md-icon.angular-material-icons.licenseIcon(aria-label="Person") person
								.md-list-item-text(flex)
									p {{license.user}}
							div(layout="row", layout-align="end center")
								p#accountLicenseMessage {{license.deleteMessage}}
								md-button.md-icon-button.md-accent(ng-click="vm.removeLicense($index)", aria-label="Close dialog", ng-if="license.showRemove")
									md-icon.angular-material-icons remove_circle

						// Unassigned
						md-list#accountLicensesUnassigned
							md-list-item(ng-repeat="unassigned in vm.unassigned track by $index")
								div(layout="row", layout-align="start center", flex)
									md-icon.angular-material-icons.licenseIcon(aria-label="Person") person
									.md-list-item-text
										p Unassigned
								md-button.md-icon-button(aria-label="Remove")
									md-icon.angular-material-icons remove_circle

					div(ng-if="vm.allLicensesAssigned")
						md-divider
						p#accountLicensesBillingPage
							| To add more licenses please go to the
							=" "
							a(href="", ng-click="vm.goToBillingPage()") Billing Page
